﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TaoSH.AppCode;
using System.Data;
using TaoSH.Data;

namespace TaoSH.View
{
    public partial class CommonView : BasePage
    {


        public string strFormCode
        {

            get { return Request.QueryString["FormCode"] ?? ""; }
        }
        public string strFormID
        {

            get { return Request.QueryString["FormID"] ?? "0"; }
        }
        public FormUControl WFForm
        {

            get { return UserControl.Controls[0] as FormUControl; }
        }
        public JH_Auth_FormBase FormBaseData
        {
            get
            {
                return ViewState[hidFormCode.Value] == null ? new CommonHelp.FormHelp().GetFormCodeByFormCode(hidFormCode.Value) : (JH_Auth_FormBase)ViewState[hidFormCode.Value];
            }
            set
            {
                ViewState[hidFormCode.Value] = value;
            }
        }

        protected override void OnInit(EventArgs e)
        {
            try
            {
                hidFormCode.Value = strFormCode;
                hidFormID.Value = strFormID;
                //加载用户控件
                FormUControl Control = LoadControl("../../View/UCMangForm/" + FormBaseData.FormViewUrl) as FormUControl;
                UserControl.Controls.Add(Control);
                base.OnInit(e);
                //为用户控件加载用户数据
                Control.UserInfo = UserInfo;
                lblTitle.Text = FormBaseData.FormDec + (strFormID);
                if (!IsPostBack)
                {
                    Control.initALLForm(hidFormCode.Value);

                    Control.initMangerForm(int.Parse(strFormID));
                }
            }
            catch (Exception)
            {

                throw;
            }

        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }




    }
}